namespace ColladaDotNet.OpenTKMapping
{
	public class GeometryInstance : DocumentLibraryElement<instance_geometry>
	{
		private BindMaterial material;
		internal override void Load(instance_geometry colladaData)
		{
			base.Load(colladaData);
			if (colladaData.bind_material != null)
			{
				material = Document.CreateElement<BindMaterial>(colladaData.bind_material);
			}
		}
		public void Render()
		{
			var g = Document.GetElementByUrl<Geometry>(Collada.url);
			if (g != null)
				g.Render(material);
		}
	}
}